home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / FromTheMag / JW FLV MEDIA PLAYER 4.2 / mediaplayer.exe / player.swf / scripts / com / jeroenwijering / utils / Draw.as < prev    next >
Text File  |  2008-11-04  |  3KB  |  81 lines

  1. package com.jeroenwijering.utils
  2. {
  3.    import flash.display.MovieClip;
  4.    import flash.display.Sprite;
  5.    import flash.text.TextField;
  6.    import flash.text.TextFormat;
  7.    
  8.    public class Draw
  9.    {
  10.        
  11.       
  12.       public function Draw()
  13.       {
  14.          super();
  15.       }
  16.       
  17.       public static function rect(param1:Sprite, param2:String, param3:Number, param4:Number, param5:Number = 0, param6:Number = 0, param7:Number = 1) : Sprite
  18.       {
  19.          var _loc8_:Sprite = null;
  20.          (_loc8_ = new Sprite()).x = param5;
  21.          _loc8_.y = param6;
  22.          _loc8_.graphics.beginFill(uint(param2),param7);
  23.          _loc8_.graphics.drawRect(0,0,param3,param4);
  24.          param1.addChild(_loc8_);
  25.          return _loc8_;
  26.       }
  27.       
  28.       public static function clone(param1:MovieClip, param2:Boolean = false) : MovieClip
  29.       {
  30.          var _loc3_:Class = null;
  31.          var _loc4_:MovieClip = null;
  32.          var _loc5_:* = undefined;
  33.          _loc3_ = Object(param1).constructor;
  34.          (_loc4_ = new _loc3_()).transform = param1.transform;
  35.          _loc4_.filters = param1.filters;
  36.          _loc4_.cacheAsBitmap = param1.cacheAsBitmap;
  37.          _loc4_.opaqueBackground = param1.opaqueBackground;
  38.          if(param2 == true)
  39.          {
  40.             _loc5_ = param1.parent.getChildIndex(param1);
  41.             param1.parent.addChildAt(_loc4_,_loc5_ + 1);
  42.          }
  43.          return _loc4_;
  44.       }
  45.       
  46.       public static function clear(param1:Sprite) : void
  47.       {
  48.          var _loc2_:Number = NaN;
  49.          var _loc3_:Number = NaN;
  50.          _loc2_ = param1.numChildren;
  51.          _loc3_ = 0;
  52.          while(_loc3_ < _loc2_)
  53.          {
  54.             param1.removeChildAt(0);
  55.             _loc3_++;
  56.          }
  57.          param1.scaleX = param1.scaleY = 1;
  58.       }
  59.       
  60.       public static function text(param1:Sprite, param2:String, param3:Number, param4:Number, param5:String, param6:String = "left", param7:Number = 12, param8:String = "Arial") : TextField
  61.       {
  62.          var _loc9_:TextField = null;
  63.          var _loc10_:TextFormat = null;
  64.          _loc9_ = new TextField();
  65.          _loc10_ = new TextFormat();
  66.          _loc9_.autoSize = param6;
  67.          _loc9_.selectable = false;
  68.          _loc10_.font = param8;
  69.          _loc10_.color = param2;
  70.          _loc10_.size = param7;
  71.          _loc10_.underline = false;
  72.          _loc9_.defaultTextFormat = _loc10_;
  73.          _loc9_.x = param3;
  74.          _loc9_.y = param4;
  75.          _loc9_.text = param5;
  76.          param1.addChild(_loc9_);
  77.          return _loc9_;
  78.       }
  79.    }
  80. }
  81.